<?php /* @var $this Controller */ ?>
<?php $this->beginContent('//layouts/main'); ?>
<?php 
$checkpoint = array(
        array('label'=>Yii::t('view','New Checkpoint'),'url'=>array('monitoring/create'), 'icon'=>'fa fa-plus-square', 'visible'=>Yii::app()->user->isAdmin() || Yii::app()->user->isWeigher()),
        array('label'=>Yii::t('view','List Checkpoint'),'url'=>array('viewcheckpoint/'), 'icon'=>'fa fa-tasks'),
        array('label'=>Yii::t('view','List Monitoring'),'url'=>array('viewmonitoring/'), 'icon'=>'fa fa-clock-o'),
);

$master = array(
	array('label'=>Yii::t('view','Ticket Card'),'url'=>array('kartu/'), 'icon'=>'fa fa-credit-card'),
        array('label'=>Yii::t('view','Car'),'url'=>array('mobil/'), 'icon'=>'fa fa-truck'),
        array('label'=>Yii::t('view','Warehouse'),'url'=>array('gudang/'), 'icon'=>'fa fa-exchange'),
        array('label'=>Yii::t('view','Rute'),'url'=>array('rute/'), 'icon'=>'fa fa-road'),
        array('label'=>Yii::t('view','Car Type'),'url'=>array('jenismobil/'), 'icon'=>'fa fa-truck'),
);
$user = array(
        array('label'=>'User','url'=>array('user/'), 'icon'=>'fa fa-user'),
);
?>
<body>
<?php $this->widget('bootstrap.widgets.TbNavbar',array(
    'fluid'=>true,
    'type'=>'inverse',
    'items'=>array(
                        array('class'=>'bootstrap.widgets.TbMenu',
				'htmlOptions'=>array('class'=>'pull-right'),
				'items'=>array(
					array('label'=>'', 'url'=>'#', 'icon'=>'fa fa-user', 'visible'=>!Yii::app()->user->isGuest, 'items'=>array(
						array('label'=>'Profile', 'url'=>array('/profil/'.Yii::app()->user->getState('profilID')), 'icon'=>'fa fa-user','visible'=>!Yii::app()->user->isGuest),
						array('label'=>'Account', 'url'=>array('/user/update/'.Yii::app()->user->id), 'icon'=>'fa fa-key','visible'=>!Yii::app()->user->isGuest),
						array('label'=>'User Management', 'url'=>array('/user/'), 'icon'=>'fa fa-users','visible'=>Yii::app()->user->isAdmin()),
						'---',
						array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'icon'=>'fa fa-power-off',),
		
					)),
				),
			),
    ),
)); ?>

<div id="page" class="container-fluid">
<div class="row-fluid">
	
	<div class="span2">
		<div id="sidebar">
		
                <!-- Checkpoint -->
		<?php $box = $this->beginWidget(
		    'bootstrap.widgets.TbBox',
		    array(
		        'title' => 'Checkpoint',
		        'headerIcon' => 'icon- fa fa-sitemap'
		    )
		);?>

		<?php
			$this->widget(
				'bootstrap.widgets.TbTabs',
				array(
					'type' => 'list',
                                        'stacked' => true,
					'tabs'=>$checkpoint,
				)
			);
		?>

		<?php $this->endWidget(); ?>
                <!-- Data Master -->
               <?php if(Yii::app()->user->isAdmin()):?>
		<?php $box = $this->beginWidget(
		    'bootstrap.widgets.TbBox',
		    array(
		        'title' => 'Data Master',
		        'headerIcon' => 'icon- fa fa-sitemap',
		    )
		);?>

		<?php
			$this->widget(
				'bootstrap.widgets.TbTabs',
				array(
					'type' => 'list',
                                        'stacked' => true,
					'tabs'=>$master,
				)
			);
		?>

		<?php $this->endWidget(); ?>
                <?php endif;?>
		</div><!-- sidebar -->
	</div>

	<div class="span10">
		<div id="content">

                        <?php //if(isset($this->breadcrumbs)):?>
                                <?php //$this->widget('bootstrap.widgets.TbBreadcrumbs', array(
                                       // 'links'=>$this->breadcrumbs,
                               // )); ?><!-- breadcrumbs -->
                        <?php //endif?>
                                
			<?php echo $content; ?>
		</div><!-- content -->
	</div>
	
</div>

	<div class="clear"></div>

	<div id="footer">
            <?php
            $this->widget('bootstrap.widgets.TbNavbar', array(
                    'brand' => '<small>Copyright &copy; 2014 by Wily Yanuar Kusumawardani. All Rights Reserved</small>',
                    'fixed' => 'bottom',
            ));
            ?>
	</div><!-- footer -->

</div><!-- page -->
</body>
<div><hr></div>
<?php $this->endContent(); ?>